package com.example.demo;

import android.animation.TypeEvaluator;


public class PointEvaluator implements TypeEvaluator {
    @Override
    public Object evaluate(float fraction, Object startValue, Object endValue) {
        Point pStart = (Point) startValue;
        Point pEnd = (Point) endValue;

        int currentX = (int) (pStart.getX() + fraction * (pEnd.getX() - pStart.getX()));
        int currentY = (int) (pStart.getY() + fraction * (pEnd.getY() - pStart.getY()));

        return new Point(currentX,currentY);
    }
}
